// pages/find/find.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    discountProduct: [
      {price: 98, oriPrice: 236, pic: '/images/goods/bag.jpg'},{price: 49, oriPrice: 88, pic: '/images/goods/milk.jpg'},{price: 499, oriPrice: 850, pic: '/images/goods/watch.jpg'},{price: 1999, oriPrice: 2360, pic: '/images/goods/notebook.jpg'}
    ],
    productList: [],
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    var productList = this.initDate();
    this.setData({productList:productList})
  },
  initDate:function(){
    var productList=[];
    var goods1=new Object();
    goods1.img="/images/goods/notebook.jpg"
    goods1.title="笔记本电脑"
    goods1.type="数码产品"
    goods1.price=1999
    goods1.soldNum=20000
    goods1.concern="5人关注"
    productList[0]=goods1

    var goods2=new Object();
    goods2.img="/images/goods/bag.jpg"
    goods2.title="可爱包包"
    goods2.type="潮流"
    goods2.price=98
    goods2.soldNum=20000
    goods2.concern="100人关注"
    productList[1]=goods2
    
    var goods3=new Object();
    goods3.img="/images/goods/milk.jpg"
    goods3.title="特仑苏"
    goods3.type="食品"
    goods3.price=49
    goods3.soldNum=10000
    goods3.concern="9人关注"
    productList[2]=goods3

    var goods4=new Object();
    goods4.img="/images/goods/watch.jpg"
    goods4.title="电话手表"
    goods4.type="数码产品"
    goods4.price=399
    goods4.soldNum=100
    goods4.concern="99人关注"
    productList[3]=goods4

    return productList;
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})